Feat/gitea connector - #12
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds first-class Gitea support and improves CLI/client robustness when a KB returns files: null, along with corresponding docs/version updates.
Changes:
- Introduce a new
GiteaConnector(including wildcardgitea:owner/*) and CLI source resolution support. - Fix
fileshandling in CLI status and client to treatnullas an empty list. - Add/adjust tests and documentation; bump version to
0.3.8.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/oikb/connectors/gitea.py |
Adds Gitea connector implementation (tree manifest + raw downloads + wildcard repo listing). |
src/oikb/cli.py |
Routes gitea: sources to the new connector; improves --branch help text; handles files: null in status. |
src/oikb/client.py |
Treats files: null as [] when listing KB files. |
tests/test_gitea_connector.py |
Adds unit tests covering parsing, manifest building (path + pagination), wildcard behavior, and raw reads. |
tests/test_cli_status.py |
Adds regression test for status when files is null. |
docs/guide.md |
Documents Gitea usage and updates connector count/list. |
README.md |
Updates connector count/list and adds Gitea examples. |
CHANGELOG.md |
Documents new Gitea features for 0.3.7/0.3.8. |
src/oikb/__init__.py |
Bumps library version to 0.3.8. |
pyproject.toml |
Bumps project version to 0.3.8. |
.gitignore |
Ignores .env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| resp = self._http.get( | ||
| f"/repos/{self.owner}/{repo}/git/trees/{ref}", | ||
| params={"recursive": "true", "per_page": 100, "page": page}, | ||
| ) |
| connector = GiteaConnector( | ||
| owner="owner", | ||
| repo="repo", | ||
| branch="main", | ||
| path="docs", | ||
| base_url="https://gitea.example.com", | ||
| ) |
| while True: | ||
| resp = self._http.get( | ||
| f"/repos/{self.owner}/{repo}/git/trees/{ref}", | ||
| params={"recursive": "true", "per_page": 100, "page": page}, |
| page = 1 | ||
|
|
||
| while True: | ||
| resp = self._http.get(f"/orgs/{self.owner}/repos", params={"page": page, "limit": 50}) |
|
Is there a timeline on this getting merged into a release? |
|
Should we tag the maintainers? |
|
Bump |
|
Can anyone clarify what is needed to move forward on this? I'm a systems engineer, not a developer. But maybe I could work through this. The current status shows "This branch has conflicts that must be resolved" and "Changes can be cleanly merged." Would a potential next step be this?
|
|
I can do it, as it was originally ready to merge. |
This pull request introduces a new Gitea source connector to sync repositories from self-hosted Gitea instances into Open WebUI Knowledge Bases. The Gitea connector supports both single-repo and wildcard (all repos for an owner/org) syncing, with branch and subdirectory scoping, and uses Gitea's API for efficient incremental syncs. The documentation, CLI, and test suite have been updated accordingly. Additionally, minor robustness improvements were made to handle empty file lists in API responses.
Gitea Connector Integration:
GiteaConnectorinsrc/oikb/connectors/gitea.pyto support syncing from Gitea repositories, including wildcard owner/org sources (gitea:owner/*) that sync all repositories under an owner, with files prefixed by repository name to avoid path collisions. Supports branch and subdirectory scoping, and uses the Gitea API for incremental sync checksums and file downloads.src/oikb/cli.py) to dispatchgitea:sources to the new connector, and clarified branch option help text to refer to "Git repository sources" instead of just GitHub. [1] [2] [3]Documentation Updates:
README.mdanddocs/guide.mdto document the new Gitea connector, example usage, and increased the connector count to 45. Gitea is now listed in all relevant tables and usage examples, including support for wildcard syncing and required environment variables. [1] [2] [3] [4] [5] [6]Robustness and Bugfixes:
filesfields that may beNonein API responses, ensuring that file lists default to empty lists to prevent errors in status reporting and file listing. [1] [2]Testing:
filesfields gracefully.Changelog and Versioning:
CHANGELOG.mdfor versions 0.3.7 and 0.3.8 to document the addition of the Gitea connector and wildcard syncing.pyproject.tomlandsrc/oikb/__init__.pyto 0.3.8. [1] [2]